/**
 * Created by gzq on 13-12-24.
 */
$NL.defined("NengLong.MicroLive.Module.User.Register.Model", ["js/core/nenglong.mvc.js"], function () {
    $NL.cls(NengLong.Mvc.Model, function () {
        var self=this;
        this._default = {
            name:""
        };
        this.cmd = {
            "login":"UserLogin"
        }
        this.login = function (searchParams, callback) {
            if (searchParams == null) searchParams = {};
            this.request(this.cmd.login, searchParams, callback, NengLong.Mvc.Config.httpLoginUrl);
        }

        this.getRememberLoginInfo = function() {
            //var resObj = window.localStorage.getItem("rememberLoginInfo");
            var resObj = NengLong.Util.Cookie.getCookie("rememberLoginInfo");
            if (!resObj) {
                return null;
            }
            resObj = JSON.parse(resObj);
            return resObj;
        }
        this.setRememberLoginInfo = function (loginInfo) {
            if (!loginInfo) {
                NengLong.Util.Cookie.delCookie("rememberLoginInfo");
            } else {
                NengLong.Util.Cookie.setCookie("rememberLoginInfo", JSON.stringify(loginInfo));
            }
        }
        this.setSessionId=function(sid){
            NengLong.Util.Cookie.setCookie("jxpt_sessionid",sid);
        }

    });
});

